#ifndef TIME_FORMATTER_H_INCLUDED
#define TIME_FORMATTER_H_INCLUDED

#include <e32std.h>
#include <e32base.h>

class TTimeFormatter
{
public:
  enum TMode {EJustFormat, EPrependWith0BasedNumberOfDays};
  TTimeFormatter(const TDesC& aTimeFormat, TMode aMode = EJustFormat);

  TPtrC FormatTimeL(const TTime& aTime);

  template <class TTimeInterval>
  TPtrC FormatAsTimeL(const TTimeInterval& aInterval)
  {
    TTime time(0);
    time += aInterval;
    return FormatTimeL(time);
  }
 
private:
  TMode iMode;
  TBuf<KMaxTimeFormatSpec> iTimeFormatSpec;
  TBuf<100> iFormatBuffer;
};

#endif // TIME_FORMATTER_H_INCLUDED
